package com.api.shopapi.service;



import com.api.shopapi.entity.Staff;
import com.api.shopapi.entity.dto.StaffDTO;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface StaffService {

    int insert(Staff staff);

    int deleteByStaffCode(String staffCode);

    int updateByStaffCode(Staff staff);

    Staff getByStaffCode(String staffCode);

    Staff getByLoginName(String loginName);

    Staff getByPhone(String phone);

    Staff getByLoginNamePassword(String phone, String password);

    //根据角色名和机构Code获取机构管理员角色的职工
    Staff getByRoleNameGovernmentCode(String roleName, String governmentCode);


    List<Staff> getList();

    List<StaffDTO> getListStaffDTO();

    List<Staff> getListByRoleNameGovernmentCode(String roleName, String governmentCode);

    PageInfo<Staff> getPageInfo(int pageIndex, int pageSize);

    PageInfo<StaffDTO> getPageInfoStaffDTO(int pageIndex, int pageSize);

    List<StaffDTO> getListStaffDTOByGovernmentCode(String governmentCode);

    PageInfo<StaffDTO> getPageInfoStaffDTOByGovernmentCode(int pageIndex, int pageSize, String governmentCode);


    List<StaffDTO> getListStaffByGovernmentCode(String governmentCode);


    PageInfo<StaffDTO> getListForSelect(int pageIndex,
                                        int pageSize,
                                        String governmentCode,
                                        String realName,
                                        String phone);



    PageInfo<StaffDTO> getListForBusiness111(int pageIndex,
                                             int pageSize,
                                             String governmentCode,
                                             String realName,
                                             String phone);






    PageInfo<StaffDTO> getListForBusiness(int pageIndex,
                                          int pageSize,
                                          String governmentCode,
                                          String realName,
                                          String phone,
                                          String parentStaffCode);


    //超级管理员只能查看系统管理员
    PageInfo<Staff> getListStaffForAdmin(int pageIndex, int pageSize);

    PageInfo<StaffDTO> getListStaffForGovAdmin(int pageIndex, int pageSize);

    PageInfo<StaffDTO> getListStaffForSeats(int pageIndex, int pageSize);

    List<StaffDTO> getUnboundForSeats(String governmentCode,String staffCode);

    List<StaffDTO> getByBusinessCode(String businessCode);

    List<Staff> getByGovernmentCodeAndRoleCode(String roleName,String roleCode);

    PageInfo<StaffDTO> getListForBusiness222(int pageIndex, int pageSize, String governmentCode, String realName, String phone);

    /**
     * 查询政府内某一类型的所有职工
     * */
    PageInfo<Staff> pageByGovCodeRoleName(int pageIndex, int pageSize, String governmentCode,String roleName, String realName, String phone);


    /**
     * 查询机构内某一类型的所有职工
     * */
    PageInfo<Staff> pageByInsCodeRoleName(int pageIndex, int pageSize, String institutionCode,String roleName, String realName, String phone);


    /**
     * 远程模糊查询
     * @param realName
     * @return
     */
    List<Staff>  query(String realName);
}
